from common.mysql_operate import MySQLDatabase
from config.mysql_config import DB_CONFIG

def main():
    # 初始化数据库连接
    db = MySQLDatabase(DB_CONFIG)

    # 插入操作示例
    new_user = {
        'name': '张三',
    }
    rows_inserted = db.insert('tb_user', new_user)
    print(f"\n插入了 {rows_inserted} 条记录")

    # 关闭连接
    db.close()

if __name__ == "__main__":
    main()